package org.example.slave.packet;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.example.slave.util.ByteUtil;

/**
 * @author dingrui
 * @since 2022/2/15
 * @description
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class AuthSwitchRequestMoreData extends CommandPacket {

    private int status;
    private byte[] authData;

    @Override
    public void fromBytes(byte[] data) {
        int index = 0;
        // 1. read status
        status = data[index];
        index += 1;
        authData = ByteUtil.readNullTerminatedBytes(data, index);
    }
}
